package com.example.manpower.Mapper;

import com.example.manpower.Dto.SalartStats;
import com.example.manpower.Entity.Salary;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author asus
* @description 针对表【salary】的数据库操作Mapper
* @createDate 2024-10-11 09:56:26
* @Entity com.example.manpower.Entity.Salary
*/
@Mapper
public interface SalaryMapper extends BaseMapper<Salary> {

    List<SalartStats> select(@Param("salartStats")SalartStats salartStats);
    @Select("SELECT COALESCE(SUM(basic_wage + bonus + assistance + five_insurances), 0)\n" +
            "FROM salary WHERE user_id = #{userId}")
    Double getTotalSalaryByUserId(@Param("userId") Integer userId);


}




